package cn.jiyun.controller;

import cn.jiyun.pojo.Major;
import cn.jiyun.res.JsonRes;
import cn.jiyun.service.MajorService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("major")
public class MajorController {
    @Reference
    MajorService majorService;
    @RequestMapping("findPage")
    public Page<Major> findPage(Integer pageNum, Integer pageSize, @RequestBody Major major){
        return majorService.findPage(pageNum,pageSize,major);
    }
    @RequestMapping("addMajor")
    public JsonRes addMajor(@RequestBody Major major){
        return majorService.addMajor(major);
    }
    @RequestMapping("updateMajor")
    public JsonRes updateMajor(@RequestBody Major major){
        return majorService.updateMajor(major);
    }
    @RequestMapping("delMany")
    public JsonRes delMany(Integer[] ids){
        return majorService.delMany(ids);
    }

}
